package com.tanhua.model.vo;

/**
 * @Author: cl
 * @Date: 2022/5/11 - 05 - 11
 * @Description:
 */

import com.tanhua.model.domain.UserInfo;
import com.tanhua.model.mongo.Visitors;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

/**
 * 访客，相互喜欢，喜欢，粉丝，
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserVo {

    private Integer id;
    private String avatar;
    private String nickname;
    private String gender;
    private Integer age;
    private String city;
    private String education;
    private Integer marriage;
    private Integer matchRate;//缘分值
    private boolean alreadyLove;

    /**
     * 在vo对象中，补充一个工具方法，封装转化过程
     */
    public static UserVo init(UserInfo userInfo) {
        UserVo vo = new UserVo();
        BeanUtils.copyProperties(userInfo, vo);
        return vo;
    }
}
